{extends 'base/site2.html'}
{block name="page_header"}{include file="common/header.html" inline}{/block}
{block name="page_nav"}{include file="common/slide-nav.html" inline}{/block}
{block name="page_styles"}
    <link rel="stylesheet" type="text/css" href="/css/mediation/role/index.css" />
{/block}
{block name="page_scripts"}
<script type="text/javascript" src="/js/mediation/role/role.min.js" init="mediation/role/role"></script>
{/block}
{block name="page_section"}
    <input type="hidden" role-ele="edit">
    <div class="sessionPage">
        <div class="page-header">
          <div class="left">
            <span class="line"></span>
            <strong class="tit">权限编辑</strong>
          </div>
        </div>
        <div class="row mr-none" style="width:95%;margin:0 auto;">
            <form class="form-horizontal col-lg-12 pad-no" action="/role/edit?id={if isset($roleInfo['id'])}{$roleInfo['id']}{/if}" method="post" role="ajaxfrom" id="form">
                <div class="form-group" style="display:flex;align-items:center;">
                    <label for="inputEmail3" class="col-sm-2 col-lg-1 control-label" style="width:auto;">角色名称</label>
                    <div class="col-sm-5 col-lg-4" style="display:flex;align-items:center;">
                        <input type="text" name="role[title]" class="form-control" role-ele="role-name" id="inputEmail3" placeholder="请输入~" value="{if isset($roleInfo['title'])}{$roleInfo.title}{/if}">
                        <input type="hidden" name="role[id]" role-ele="role-id" value="{if isset($roleInfo['id'])}{$roleInfo['id']}{/if}">
                    </div>
                </div>
                {if $arrProvisions}
                    {foreach from=$arrProvisions item=item}
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-1 col-lg-1 control-label" style="width: 15%!important;" ><font color="#007bff"><span class="nav-icon glyphicon {$item.icon}" aria-hidden="true"></span>{$item.name}</font></label>
                            <hr/>
                            {foreach from=$item['data_new'] key=key item=prov}
                                <div class="form-group"  >
                                    <label  style="width:auto;" for="inputPassword3" class="col-sm-1  col-lg-2 control-label">{$key}</label>
                                    </br>
                                    </br>
                                    {foreach from=$prov key=key1 item=prov1}
                                        <div class="col-sm-offset-1 col-lg-offset-2 col-sm-10 col-lg-2">
                                            <label class="checkbox-inline">
                                                <input type="checkbox" id="inlineCheckbox1" role-ele="role-check" name="role[provisioning][]" value="{$prov1.id}" {if in_array($prov1.id, $arrUserProv)}checked{/if}> {$prov1.name}
                                            </label>

                                        </div>
                                    {/foreach}
                                </div>

                            {/foreach}
                        </div>
                    {/foreach}
                {/if}
                <div class="form-group mr-t50 mr-b20">
                    <button type="submit" id="submitRole" class="btn btn-primary  col-lg-2 col-md-offset-2">保存</button>
                    <a href="/role/index">
                        <button type="button" class="btn btn-default  col-lg-2 col-md-offset-2">返回</button>
                    </a>
                </div>
            </form>
        </div>
    </div>
{/block}
